home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Imágenes y mapas de bits / ImageScaleToRectangle / ImageScaleToRectangle.cs next >
Encoding:
Text File  |  2002-05-06  |  739 b   |  27 lines

  1. //----------------------------------------------------
  2. // ImageScaleToRectangle.cs ⌐ 2001 by Charles Petzold
  3. //------------------ ----------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class ImageScaleToRectangle: PrintableForm
  9. {
  10.      Image image;
  11.  
  12.      public new static void Main()
  13.      {
  14.           Application.Run(new ImageScaleToRectangle());
  15.      }
  16.      public ImageScaleToRectangle()
  17.      {
  18.           Text = "Escalar imagen a un rectßngulo";
  19.  
  20.           image = Image.FromFile("..\\..\\..\\Apollo11FullColor.jpg");
  21.      }
  22.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  23.      {
  24.           grfx.DrawImage(image, 0, 0, cx, cy);
  25.      }
  26. }
  27.